using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using THSLib;

namespace THSERP.BaseProvider
{
    public partial class uiInventoryInformation : DevExpress.XtraEditors.XtraUserControl
    {
        public BaseModuleERP _module;
        public uiInventoryInformation()
        {
            InitializeComponent();
        }

        public uiInventoryInformation(BaseModuleERP mdl)
        {
            InitializeComponent();
            _module = mdl;
        }

        public BaseModuleERP Module
        {
            get
            {
                return _module;
            }
            set
            {
                _module = value;
            }
        }

        #region Calculate Product Quantity on Stock

        public void ShowTotalProductQuantityForAllStock(double dbTotalStockQuantity,
                                                        double dbTotaProposalStockQuantity,
                                                        double dbTotalSellOrderStockQuantity,
                                                        double dbTotalPurchaseOrderStockQuantity)
        {
            fld_txtTotalStockQuantity.Text = dbTotalStockQuantity.ToString();

            fld_txtTotalProposalStockQuantity.Text = dbTotaProposalStockQuantity.ToString();

            fld_txtTotalSellOrderStockQuantity.Text = dbTotalSellOrderStockQuantity.ToString();

            fld_txtTotalPurchaseOrderStockQuantity.Text = dbTotalPurchaseOrderStockQuantity.ToString();

            double dbTotalStockQtySum = dbTotalStockQuantity - dbTotaProposalStockQuantity - dbTotalSellOrderStockQuantity; //+dbTotalPurchaseOrderStockQuantity
            fld_txtTotalStockQuantitySum.Text = dbTotalStockQtySum.ToString();
        }


        public void ShowProductQuantityForProductStock(double dbStockQuantity,
                                                        double dbProposalStockQuantity,
                                                        double dbSellOrderStockQuantity,
                                                        double dbPurchaseOrderStockQuantity,
                                                        String strMAStockName)
        {
            fld_txtStockQuantity.Text = dbStockQuantity.ToString();

            fld_txtProposalStockQuantity.Text = dbProposalStockQuantity.ToString();

            fld_txtSellOrderStockQuantity.Text = dbSellOrderStockQuantity.ToString();

            fld_txtPurchaseOrderStockQuantity.Text = dbPurchaseOrderStockQuantity.ToString();

            double dbStockQtySum = dbStockQuantity - dbProposalStockQuantity - dbSellOrderStockQuantity; //+ dbPurchaseOrderStockQuantity
            fld_txtStockQuantitySum.Text = dbStockQtySum.ToString();

            fld_lblStock.Text = String.Format("Lager:{0}", strMAStockName);
        }        
        
        #endregion
    }
}
